module.exports = {
    // publicPath: ['production','alpha'].includes(process.env.NODE_ENV) ? '/dispatch/' : '/',
    publicPath: './',
    // outputDir: '../web/dispatch',
    lintOnSave: false,
    productionSourceMap:false,
    chainWebpack: config => {
        config.entry('main').add('babel-polyfill')
    },
    css: {
        loaderOptions: {
            less: {
                modifyVars: {
                    /* less 变量覆盖，用于自定义 ant design 主题 */
                    'primary-color': '#1890FF',// 全局主色
                    'link-color': '#1890FF',// 链接色
                    'border-radius-base': '4px',    //组件/浮层圆角
                    'heading-color': '#C8D0E9',              // 标题色
                    'text-color': '#C8D0E9',                 // 主文本色
                    'text-color-secondary': '#C8D0E9',      // 次文本色
                    'border-color-base': '#000',                // 边框色

                    //body
                    'body-background': '#1E2026',
                    'layout-header-height': '64px',
                    'layout-body-background': '#292C35',
                    'layout-sider-background': '#292C35',
                    'layout-sider-background-light': '#292C35',
                    'layout-header-background': '#292C35',
                    'layout-header-padding': '0',

                    'tabs-title-font-size': '16px',
                    //menu
                    'menu-inline-toplevel-item-height': '64px',
                    'menu-dark-submenu-bg': '#2F3340',
                    'menu-dark-bg': '#292C35',
                    'menu-highlight-color': '#fff',
                    'menu-item-active-bg': '#2F3340',
                    'menu-dark-popup-bg': '#6797CE',
                    'menu-dark-item-active-bg': '#2F3340',
                    'menu-dark-color': '#6D839C',
                    'menu-item-color': '#6D839C',
                    'menu-dark-highlight-color': '#fff',

                    //Breadcrumb
                    'breadcrumb-base-color': '#7BA2CD',
                    'breadcrumb-separator-color': '#7BA2CD',
                    'breadcrumb-last-item-color': '#7BA2CD',
                    'breadcrumb-link-color': '#7BA2CD',
                    'breadcrumb-link-color-hover': '#7BA2CD',

                    //input
                    'input-height-base': '40px',
                    'input-placeholder-color': '#4E556A',
                    'input-color': '#C8D0E9',
                    'input-border-color': '#000000',
                    'input-bg': '#16181b',
                    'input-addon-bg': '#16181b',
                    'input-hover-border-color': '#000000',

                    //form
                    'label-required-color': '#FB374C',

                    //table
                    'table-row-hover-bg': '#323D60',
                    'table-header-bg': '#1e2026',
                    'table-body-sort-bg': '#1e2026',
                    'table-selected-row-bg': '#1e2026',
                    'table-expanded-row-bg': '#1e2026',
                    'table-header-sort-bg': '#1e2026',
                    'table-header-color': '#C8D0E9',

                    //button
                    'btn-height-base': '38px',
                    'btn-primary-color': '#C8D0E9',
                    'btn-font-size-sm': '16px',

                    //tree
                    'tree-directory-selected-bg': '#394047',

                    //modal
                    'modal-header-bg': '#292C35',

                    //TimePicker
                    'time-picker-selected-bg': '#334458',

                    // Message
                    'message-notice-content-padding': '10px 30px',

                    'disabled-color': 'grey',

                },
                javascriptEnabled: true
            }
        }
    },
    devServer: {
        proxy: {
            "/api": {
                target: process.env.VUE_APP_BASE_URL,
                // 如果要代理 websockets
                ws: false,
                changeOrigin: true,
                pathRewrite: {
                    "^/api": ""
                }
            }
        },
    }
}

